﻿using PLCTest.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PLCTest.BO
{
    public class PlanarContainerCodesBO
    {
        public string PalletBarcode { get; set; }
        public string PalletBarcode2 { get; set; }
        public string PalletBarcode3 { get; set; }
        public string PalletBarcode4 { get; set; }

        public void Serialize(byte[] bytes)
        {

            int length = HelperByte.GetSIntAt(bytes, 1);
            PalletBarcode = HelperByte.GetCharsAt(bytes, 2, length);
            int length2 = HelperByte.GetSIntAt(bytes, 21);
            PalletBarcode2 = HelperByte.GetCharsAt(bytes, 22, length2);
            int length3 = HelperByte.GetSIntAt(bytes, 41);
            PalletBarcode3 = HelperByte.GetCharsAt(bytes, 42, length3);
            int length4 = HelperByte.GetSIntAt(bytes, 61);
            PalletBarcode4 = HelperByte.GetCharsAt(bytes, 62, length4);

        }
    }
}
